package com.zz.dubbo.example.commons.resopnse;

import lombok.Data;

import java.io.Serializable;

/**
 * Created by zhouzeng on 2017/8/25.
 */
@Data
public class Code implements Serializable {
    private static final long serialVersionUID = -5709023177768707049L;
    public static final Code SUCCESS = new Code(true);
    public static final Code FAILURE = new Code(false);
    private String message;
    private Boolean success;

    public boolean isSuccess(){
        return success == true;
    }
    public Code(){}

    public Code(Code code){
        this.success = code.getSuccess();
        code.message = code.getMessage();
    }
    public Code(Boolean bool){
        this.success = bool;
    }
}